﻿using System;
using Besture.Bll;
using Besture.Model;
using Besture.Common.Definition;

namespace Besture.UI.Company
{
    public partial class Contact : System.Web.UI.Page
    {
        //Banner图
        public ImageModel _BannerTop { get; set; }
        public AboutModel _About { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RpMaps.DataSource = new ContactDac().GetDataTable();
                RpMaps.DataBind();
            }
            GetBanner();
        }

        #region 获取Banner
        /// <summary>
        /// 获取Banner
        /// </summary>
        public void GetBanner()
        {
            AboutDac longContentDac = new AboutDac();
            AboutModel amodel = longContentDac.GetModelByType(Constants.DICTIONARY_CODE_CompanyContact);
            if (amodel != null)
                _About = amodel;
            else
                _About = new AboutModel();

            ImageDac imageDac = new ImageDac();
            ImageModel imgModel = imageDac.GetDataTableByCode(Constants.DICTIONARY_CODE_BannerCompany, Constants.DICTIONARY_TYPE_IMAGES);
            if (imgModel != null)
                _BannerTop = imgModel;
            else
                _BannerTop = new ImageModel();
        }
        #endregion
    }
}